import request from '@/utils/request'

export const RegionApi = {

    /**
     *  查询子级列表
     * @returns
     */
    getChildList: (parentCode) => {
        return request({
            url: '/manage/system/region/getChildList',
            method: 'get',
            params:{parentCode}
        })
    },
    /**
     *  删除
     * @returns
     */
    delete: (id) => {
        return request({
            url: '/manage/system/region/delete',
            params: { id },
            method: 'get'
        })
    },

    /**
     *  更新
     * @returns
     */
    edit: (data) => {
        return request({
            url: '/manage/system/region/edit',
            data,
            method: 'post'
        })
    },

    /**
     *  插入
     * @returns
     */
    create: (data) => {
        return request({
            url: '/manage/system/region/create',
            data,
            method: 'post'
        })
    },
    /**
     *  获取缓存数据
     * @returns
     */
    getCacheRegion: (cacheName) => {
        return request({
            url: process.env.VUE_APP_OSS_HOST+'/static/'+cacheName+'.json',
            method: 'get'
        })
    },
}
